<!DOCTYPE html>
<html>
  <head>
    <style>
      body {
          font-size: 13px;
          font-family: sans-serif;
      }
      table {
          padding: 2px;
      }
      input {
          padding: 5.5px;
      }
    </style>
  </head>
  <body>
    <fieldset>
      <table>
        <tr>
          <td>
            <input type="text" value="Caret"/>
          </td>
        </tr>
      </table>
    </fieldset>
    <script>

        if (window.testRunner)
            testRunner.waitUntilDone();

        function test()
        {
            var el = document.getElementsByTagName('input')[0];
            el.focus();
            var step = function() {
                var value = el.value;
                if (value) {
                    el.value = value.substr(0, value.length - 1);
                    window.setTimeout(step, 10);
                }
                else if (window.testRunner)
                    testRunner.notifyDone();
            };
            step();
        }

        test();
    </script>
  </body>
</html>
